/**
 * CustomizedPropertyPlaceholderConfigurer.java	  V1.0   2014-4-10 上午10:09:53
 *
 * Copyright GTA Information System Co. ,Ltd. All rights reserved.
 *
 * Modification history(By    Time    Reason):
 * 
 * Description:
 */

package com.front.bean;

import java.util.HashMap;
import java.util.Map;
import java.util.Properties;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;

/***
 * 
 * @author Administrator
 *
 */
public class FrontPropertyPlaceholderConfigurer extends
		PropertyPlaceholderConfigurer {
	private Map<String,String> ctxPropertiesMap;
	
   /***
    * 
    * 
    */
    @Override
    protected void processProperties(ConfigurableListableBeanFactory beanFactoryToProcess,
                                     Properties props) throws BeansException {
        super.processProperties(beanFactoryToProcess, props);
        ctxPropertiesMap = new HashMap<String,String>();
        for (Object key : props.keySet()) {
            String keyStr = key.toString();
            String value = props.getProperty(keyStr);
            ctxPropertiesMap.put(keyStr, value);
        }
    }
    
 
    public Object getContextProperty(String name) {
        return ctxPropertiesMap.get(name);
    }

	public Map<String, String> getCtxPropertiesMap() {
		return ctxPropertiesMap;
	}

	public void setCtxPropertiesMap(Map<String, String> ctxPropertiesMap) {
		this.ctxPropertiesMap = ctxPropertiesMap;
	}
    
}
